EXEC=run	# name of executable is run
CC=g++		# compile with g++
CFLAGS=-std=c++11 -c  -Wall 

all: $(EXEC)

$(EXEC): parser.o lexer.o symbolTable.o semantic.o
	$(CC) -o $(EXEC) parser.o lexer.o symbolTable.o semantic.o

parser.o: parser.cpp
	$(CC) $(CFLAGS) parser.cpp

lexer.o: lexer.cpp lexer.hpp
	$(CC) $(CFLAGS) lexer.cpp

symbolTable.o: symbolTable.cpp symbolTable.hpp
	$(CC) $(CFLAGS) symbolTable.cpp

semantic.o: semantic.cpp semantic.hpp
	$(CC) $(CFLAGS) semantic.cpp
	
clean: 
	rm -f *.o
	rm -f $(EXEC)
	rm -f *output.txt
